package com.njlime.cms.repository.sys;

import com.njlime.cms.entities.Information;
import com.njlime.core.helper.PageBean;
import com.njlime.sys.entities.Unit;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;
import java.util.Map;

/**
 * Created by Dean on 2017-7-27.
 */
public interface InformationDao extends JpaRepository<Information, Integer>,JpaSpecificationExecutor<Information> {
    Map<String, Object> get(int id);
    int editInfo(Information information);
    int del(int id);
    int toggleComment(int id);
    PageBean list(PageBean pageBean, Information information, boolean is_all);
    int updateReading(int id);
    void updateCommentNum(Integer informationId, Integer num);
    /**
     * 根据频道和栏目查询列表
     * @param channelId 频道id
     * @param columnId 栏目id 0表示无栏目
     * @param isBannel 是否显示轮播 0表示不显示
     *
     * @return
     */
    public List listByChannelId(int channelId, int columnId,int isBannel);

    Map<String,Object> welcomeReport(Unit unit);
}
